#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"2.h"

static int cmp_int(const void * p1, const void *p2);
static int cmp_char(const void * p1, const void *p2);


int main(int argc, char *argv[])
{
	int arr[] = {1,2,3,4,5,6,7,9,10};
	int len = sizeof(arr) / sizeof(int);
	int key;
	char key1;
	int *ans;
	char *ans1;
	scanf("%d", &key);
	getchar();
	ans = binsearch(&key, arr, len, sizeof(int),cmp_int);
	if(ans != NULL){
		printf("%ld\n", ans - arr);
	}else{
		printf("no\n");
	}
	scanf("%c", &key1);
	char str[] = "abcdefghklmn";
	ans1 = binsearch(&key1, str, strlen(str) - 1, sizeof(char), cmp_char);
	if(ans1 != NULL){
		printf("%ld\n", ans1 - str);
	}else{
		printf("no\n");
	}
	


	return 0;
}

static int cmp_int(const void * p1, const void *p2){
	const int *q1 = (const int *)p1;
	const int *q2 = (const int *)p2;

	return *q1 - *q2;
}


static int cmp_char(const void * p1, const void *p2){
	const char *q1 = (const char *)p1;
	const char *q2 = (const char *)p2;

	return *q1 - *q2;

}




